package com.est.dase;

import android.app.Activity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;

import com.est.dase.adapter.ListAdapterSettings;

/**
*
* @author Fernando Geraldes, Jaime Santos, Jorge Silva
*
*/
public class Settings extends Activity{

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.settings);
		
		//String[] items = {"White List", "Black List", "More options"};
		Resources res = getResources();
		String[] items = {res.getString(R.string.settings_opt1), res.getString(R.string.settings_opt2), res.getString(R.string.settings_opt3)};
		int[] items2 = {R.drawable.star, R.drawable.hand3, R.drawable.plus};
		ListAdapterSettings listAdapter = new ListAdapterSettings(this, items,items2);
		
		ListView list = (ListView) findViewById(R.id.listSettings);
		list.setAdapter(listAdapter);
		
		list.setOnItemClickListener(new OnItemClickListener() {

			public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
					long arg3) {
					if(arg2==0)
						startActivity(new Intent(Settings.this, WhiteList.class));
					if(arg2==1)
						startActivity(new Intent(Settings.this, BlackList.class));
					if(arg2==2)
						startActivity(new Intent(Settings.this, Options.class));
			}
		});		
		
		//MyLocation my = new MyLocation(this);
	}
}
